package com.yc.route;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.function.RequestPredicates;
import org.springframework.web.servlet.function.RouterFunction;
import org.springframework.web.servlet.function.RouterFunctions;
import org.springframework.web.servlet.function.ServerResponse;

/**
 * @program: scholar_vibe
 * @description:
 * @author: 作者 huchaojie
 * @create: 2023-07-15 09:40
 */
@Configuration
public class CheckWorkRouteConfig {

    @Bean
    RouterFunction<ServerResponse> checkWorkRoute(CheckWorkHandler checkWorkHandler){
        return RouterFunctions.nest(
                RequestPredicates.path("/cw"),
                RouterFunctions.route(RequestPredicates.POST("/qrCodeCheck"),checkWorkHandler::qrCodeCheck)
        );
    }
}
